//
//  LetterDetailViewController.h
//  Growth
//
//  Created by Hobo.Chen on 3/29/12.
//  Copyright (c) 2012 MEETStudio. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "EGORefreshTableHeaderView.h"
#import "EGORefreshTableTailView.h"


#import "LetterDetailCell.h"

#import "WebRequest.h"
#import "WebConnection.h"
#import "WebConnetionArray.h"
#import "CJSONScanner.h"

#import "HPGrowingTextView.h"

#import "ASIHTTPConnection.h"



@interface LetterDetailViewController : UIViewController<EGORefreshTableHeaderDelegate,
EGORefreshTableTailDelegate,
UITextFieldDelegate,
UITableViewDelegate,
UITableViewDataSource,
HPGrowingTextViewDelegate,
ASIHTTPConnectionDelegate,
UIScrollViewDelegate
>{
    
    //下拉刷新
	EGORefreshTableHeaderView *_refreshHeaderView;
	BOOL _reloading;
	
	UITableView *myTableView;
	    
    NSMutableArray *chatHistoryArray;
    NSMutableArray *chatNewArray;
    
    
    //上拉刷新
    EGORefreshTableTailView *_refreshTailView;
	BOOL _TailReloading;
    
    
    //输入框
    //GRowing TextView 
    UIView *containerView;
    HPGrowingTextView *textView;
    
    IBOutlet UIButton *backGoundButton;
   
    
    //
       NSDictionary *familyDict;
    long long int refTimePoint;
    int pageNo;
    
    NSString *fid;
    
    NSString *threadID;
      

}
@property (nonatomic, retain)  NSMutableArray *chatHistoryArray;
@property (nonatomic, retain)   NSMutableArray *chatNewArray;

@property (nonatomic, retain)   NSString *threadID;


@property (nonatomic, retain)    NSDictionary *familyDict;

@property (nonatomic, retain) IBOutlet UITableView *myTableView;


@property (nonatomic,retain)  NSString *fid;

- (id)initWithThreadId:(NSString *)threadid;

- (id)initWithDict:(NSDictionary *)dict;

- (id)initWithTitle:(NSString *)title fid:(NSString *)freindId;

- (id)initWithTitle:(NSString *)title;

-(IBAction)sendLetter:(id)sender;

-(IBAction)backGroundTap:(id)sender;

-(IBAction)toUserView:(id)sender;

- (void)loadLetterDataWith:(NSString *)userId toUserId:(NSString *)toUserId;
- (void)showDial;
- (void)hideDial;

- (void)loadChatNew;

- (void)reloadChatData;

//Growing Text View 
-(void)resignTextView;
- (void)initGrowingTextView;
- (IBAction)backGroundTap;

@end
